package com.nts.visionworks.business.contents.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Range;

/**
 * UnitElement generated by hbm2java
 */
@Entity
@Table(name = "unit_element", catalog = "visionworks")
public class UnitElement implements java.io.Serializable
{

	private Integer elementId;
	private String elementName;
	private short elementType;
	private String acceptableExtension;
	private Integer thumbnailMaxWidth;
	private Integer thumbnailMaxHeight;
	private Set<ContentsTemplateElement> contentsTemplateElements = new HashSet<ContentsTemplateElement>(
			0);

	public UnitElement()
	{
	}

	public UnitElement(String elementName, short elementType)
	{
		this.elementName = elementName;
		this.elementType = elementType;
	}

	public UnitElement(String elementName, short elementType,
			String acceptableExtension, Integer thumbnailMaxWidth,
			Integer thumbnailMaxHeight,
			Set<ContentsTemplateElement> contentsTemplateElements)
	{
		this.elementName = elementName;
		this.elementType = elementType;
		this.acceptableExtension = acceptableExtension;
		this.thumbnailMaxWidth = thumbnailMaxWidth;
		this.thumbnailMaxHeight = thumbnailMaxHeight;
		this.contentsTemplateElements = contentsTemplateElements;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ElementId", unique = true, nullable = false)
	public Integer getElementId()
	{
		return this.elementId;
	}

	public void setElementId(Integer elementId)
	{
		this.elementId = elementId;
	}

	@NotNull(message="validation.contents.unitelement.elementname.notnull")
	@Range(message="validation.contents.unitelement.elementname.length", min=1, max=30)
	@Column(name = "ElementName", nullable = false, length = 30)
	public String getElementName()
	{
		return this.elementName;
	}

	public void setElementName(String elementName)
	{
		this.elementName = elementName;
	}

	@Column(name = "ElementType", nullable = false)
	public short getElementType()
	{
		return this.elementType;
	}

	public void setElementType(short elementType)
	{
		this.elementType = elementType;
	}

	@Column(name = "AcceptableExtension", length = 70)
	public String getAcceptableExtension()
	{
		return this.acceptableExtension;
	}

	public void setAcceptableExtension(String acceptableExtension)
	{
		this.acceptableExtension = acceptableExtension;
	}

	@Column(name = "ThumbnailMaxWidth")
	public Integer getThumbnailMaxWidth()
	{
		return this.thumbnailMaxWidth;
	}

	public void setThumbnailMaxWidth(Integer thumbnailMaxWidth)
	{
		this.thumbnailMaxWidth = thumbnailMaxWidth;
	}

	@Column(name = "ThumbnailMaxHeight")
	public Integer getThumbnailMaxHeight()
	{
		return this.thumbnailMaxHeight;
	}

	public void setThumbnailMaxHeight(Integer thumbnailMaxHeight)
	{
		this.thumbnailMaxHeight = thumbnailMaxHeight;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "unitElement")
	public Set<ContentsTemplateElement> getContentsTemplateElements()
	{
		return this.contentsTemplateElements;
	}

	public void setContentsTemplateElements(
			Set<ContentsTemplateElement> contentsTemplateElements)
	{
		this.contentsTemplateElements = contentsTemplateElements;
	}

}
